package cn.com.tbshuda.shell.shell.jsch;

/**
 * @author: wsd
 * @date: 2021/6/16 17:21
 */
import com.jcraft.jsch.*;
import java.awt.*;
import javax.swing.*;

public class MyLogger implements com.jcraft.jsch.Logger{

        static java.util.Hashtable name=new java.util.Hashtable();
        static{
            name.put(new Integer(DEBUG), "DEBUG: ");
            name.put(new Integer(INFO), "INFO: ");
            name.put(new Integer(WARN), "WARN: ");
            name.put(new Integer(ERROR), "ERROR: ");
            name.put(new Integer(FATAL), "FATAL: ");
        }
     @Override
        public boolean isEnabled(int level){
            return true;
        }
        @Override
        public void log(int level, String message){
            System.err.print(name.get(new Integer(level)));
            System.err.println(message);
        }


}